import { Control, controlsUtils } from "fabric";
import FabricImg from "../myFabric/FabricImg";

class CropTContorls extends Control {
    constructor(options) {
        super(options);
    }

    icon: FabricImg;

    x = 0;
    y = -0.5;
    cursorStyle = 'ns-resize';

    actionHandler = controlsUtils.scalingY;

    render(ctx, left, top, styleOverride, fabricObject) {
        if (this.icon) {
            this.icon.set({
                originX: "center",
                originY: "center",
                left,
                top,
            });
            this.icon.render(ctx);
        }
    }
}

const cropTContorls = new CropTContorls({});

export default cropTContorls;